<?php $this->headTitle('Allocation History');  ?>

<div class="box">
  <div class="left"></div>
  <div class="right"></div>
  <div class="heading">
    <h1 style="background-image: url('images/setting.png');">Allocation History</h1>
  </div>
  <div class="content">
      <table class="list">
        <thead>
          <tr>
            <td class="left">Allocation ID</td>
            <td class="left">
                <?php if((isset($this->data['sort'])) && ($this->data['sort'] == 'allocatedBy')): ?>
                <a href="<?php echo $this->url(array('do'=>'access'),'allocationHistory',true). "?sort=allocatedBy". $this->partHeadUrl; ?>" class="<?php echo strtolower($this->data['order']); ?>">Allocated By</a>
                <?php else: ?>
                <a href="<?php echo $this->url(array('do'=>'access'),'allocationHistory',true). "?sort=allocatedBy". $this->partHeadUrl; ?>">Allocated By</a>
                <?php endif; ?>
            </td>
            <td class="right">
                <?php if((isset($this->data['sort'])) && ($this->data['sort'] == 'dateAllocated')): ?>
                <a href="<?php echo $this->url(array('do'=>'access'),'allocationHistory',true). "?sort=dateAllocated". $this->partHeadUrl; ?>" class="<?php echo strtolower($this->data['order']); ?>">Date Allocated</a>
                <?php else: ?>
                <a href="<?php echo $this->url(array('do'=>'access'),'allocationHistory',true). "?sort=dateAllocated". $this->partHeadUrl; ?>">Date Allocated</a>
                <?php endif; ?>
            </td>
            <td class="right">Action</td>
          </tr>
        </thead>
        <tbody>
            <?php if($this->allocationHistory): ?>

                    <?php foreach($this->allocationHistory as $allocationHistory): ?>
                      <tr>
                        <td class="left"><?php echo $allocationHistory->allocationId; ?></td>
                        <td class="left"><?php echo $this->escape($allocationHistory->allocatedBy); ?></td>
                        <td class="right"><?php echo $allocationHistory->dateAllocated; ?></td>
                        <td class="right">[ <a href="<?php echo $this->url(array('id'=>$allocationHistory->allocationId),'allocationHistory',true)."?redir=".urlencode($this->requestUri()); ?>">View Detail </a> ]</td>
                      </tr>
        <?php endforeach; ?>

	<?php else: ?>
          <tr>
            <td class="center" colspan="4">No results!</td>
          </tr>
       <?php endif; ?>
        </tbody>
      </table>

      <?php if($this->allocationHistory instanceof Zend_Paginator):?>
          <?php echo $this->paginationControl(
                            $this->allocationHistory,
                            'Sliding',
                            '_paginator.phtml',
                            array('url'=>$this->url(array('do'=>'access'),'allocationHistory',true),
                                  'partUrl'=>$this->partPaginationUrl,
                            )
                            );
          ?>
      <?php endif ?>
  </div>
</div>